home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 13.6 KB | 484 lines | [TEXT/MPS ] |
- /*
- File: HIWindows.idl
-
- Contains: Standard window class.
-
- Version: Technology: System 8.0
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1995-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
- */
-
-
- #ifndef __HIWINDOWS_IDL__
- #define __HIWINDOWS_IDL__
-
- #include <Types.idl>
- #include <Windows.idl>
- #include <HIObjects.idl>
- #include <HIEmbeddingPanels.idl>
- #include <HIWindowTypes.idl>
-
-
-
- interface HIWindow : HIObject
- {
- // ======================================================
- // Public Methods
- // ======================================================
-
- // • Initializers •
-
- OSStatus InitWindow(in RefLabel identifier,
- in Rect globalBounds,
- in HIWindowClass windowClass,
- in HIWindowVariant windowVariant,
- in HIWindowAttributes windowAttributes,
- in HIRootPanel rootPanel,
- in HIWindow behindThisWindow);
-
- OSStatus InitWindowInLayer( in RefLabel identifier,
- in Rect globalBounds,
- in HIWindowClass windowClass,
- in HIWindowVariant windowVariant,
- in HIWindowAttributes windowAttributes,
- in HIRootPanel rootPanel,
- in HIWindow behindThisWindow,
- in HILayerRef containingLayer);
-
- // • Window state •
-
- OSStatus Select();
- OSStatus SelectWithGroup(in HIWindowGroupRef groupRef);
-
- OSStatus Hilite();
- OSStatus Unhilite();
- boolean IsHilited();
-
- boolean IsActive();
-
- OSStatus BringToFront();
- OSStatus SendBehind(in HIWindow behindThisWindow);
-
- OSStatus ShowWithoutActivate();
- OSStatus HideWithoutActivate();
-
- OSStatus Zoom( in HIWindowPartCode whichPart,
- in boolean front);
- OSStatus ZoomOut(in Point idealSize);
-
- OSStatus Collapse();
- OSStatus Expand();
- boolean IsCollapsed();
-
- // • Window groups •
-
- OSStatus SetAttachedWindowGroup(in HIWindowGroupRef groupRef);
- HIWindowGroupRef GetAttachedWindowGroup();
-
- OSStatus AddToGroup(in HIWindowGroupRef groupRef);
- OSStatus RemoveFromGroup(in HIWindowGroupRef groupRef);
-
- // • Invalidation •
-
- OSStatus InvalidateRect(in Rect badRect);
- OSStatus InvalidateRgn(in RgnHandle badRgn);
- OSStatus ValidateRect(in Rect goodRect);
- OSStatus ValidateRgn(in RgnHandle goodRgn);
-
- // • Drawing content •
-
- OSStatus SetPort();
-
- OSStatus BeginUpdate();
- OSStatus EndUpdate();
-
- OSStatus DrawGrowIcon();
-
- // • Positioning & sizing
-
- OSStatus PositionOnScreen( in Rect globalReferenceRect,
- in boolean findScreen,
- in HIWindowHorizontalConstraint horizontalConstraint,
- in HIWindowVerticalConstraint verticalConstraint);
-
- OSStatus AutoPosition( in HIWindowLocationConstraint locationConstraint,
- in HIWindowHorizontalConstraint horizontalConstraint,
- in HIWindowVerticalConstraint verticalConstraint);
-
- boolean IsPositionedOnScreen( in HIWindowPartCode whichPart,
- in boolean entirelyOnScreen);
-
- // • General accessors •
-
- OSStatus SetAttributes( in HIWindowAttributes newAttributes,
- in boolean redraw);
- HIWindowAttributes GetAttributes();
-
- OSStatus SetClass(in HIWindowClass newClass);
- HIWindowClass GetClass();
-
- OSStatus SetVariant(in HIWindowVariant newVariant);
- HIWindowVariant GetVariant();
-
- OSStatus GetStructureRgn(in RgnHandle structureCopy);
- OSStatus GetContentRgn(in RgnHandle contentCopy);
- OSStatus GetUpdateRgn(in RgnHandle updateCopy);
-
- OSStatus SetStandardState(in Rect globalStandardState);
- Rect* GetStandardState(out Rect globalStandardState);
-
- OSStatus SetUserState(in Rect globalUserState);
- Rect* GetUserState(out Rect globalUserState);
-
- OSStatus SetDefaultGrowLimits(in Point minimumSize, in Point maximumSize);
- OSStatus GetDefaultGrowLimits(out Point minimumSize, out Point maximumSize);
-
- OSStatus SetDefaultOptimalSize(in Point defaultSize);
- OSStatus GetDefaultOptimalSize(out Point defaultSize);
-
- HIRootPanel GetRootPanel();
- OSStatus SetRootPanel(in HIRootPanel thePanel);
-
- AEDispatcherRef GetEventDispatcher();
-
- // • Events •
-
- OSStatus HandleMouseDown( in Point globalPt,
- in EventModifiers modifiers,
- in AppleEvent theEvent,
- in AppleEvent reply,
- in AEHandlerTableRef handlerTableRef);
-
- OSStatus HandleMouseMoved( in Point globalPt,
- in EventModifiers modifiers,
- in AppleEvent theEvent,
- in AppleEvent reply,
- in AEHandlerTableRef handlerTableRef);
-
- OSStatus HandleMouseStoppedMoving( in Point globalPt,
- in EventModifiers modifiers,
- in AppleEvent theEvent,
- in AppleEvent reply,
- in AEHandlerTableRef handlerTableRef);
-
- OSStatus HandleMouseUp( in Point globalPt,
- in EventModifiers modifiers,
- in AppleEvent theEvent,
- in AppleEvent reply,
- in AEHandlerTableRef handlerTableRef);
-
- OSStatus HandleMouseDownInBack( in Point portLocalWhere,
- in EventModifiers modifiers,
- in AppleEvent theEvent,
- in AppleEvent reply,
- in AEHandlerTableRef handlerTableRef);
-
- OSStatus HandleUpdate( in AppleEvent theEvent,
- in AppleEvent reply,
- in AEHandlerTableRef handlerTableRef);
-
- OSStatus HandleResize( in Rect originalBounds,
- in Rect newBounds,
- in AppleEvent theEvent,
- in AppleEvent reply,
- in AEHandlerTableRef handlerTableRef);
-
- OSStatus HandleClose( in boolean closeAll,
- in AppleEvent theEvent,
- in AppleEvent reply,
- in AEHandlerTableRef handlerTableRef);
-
- // • Frame support •
-
- void AdjustDragLimits(inout Rect dragLimits);
- void AdjustGrowLimits(inout Point minimumSize, inout Point maximumSize);
-
- OSStatus TrackPart( in Point globalPt,
- in EventModifiers modifiers,
- in HIWindowPartCode whichPart);
-
- // Protected frame support methods
- // Call these methods only from within object implementation!
-
- /*
- These two calls should draw in drawPort. Drawing should be done in global coords.
- */
-
- void DrawFrame(in CGrafPtr drawPort);
- void DrawOutline( in Rect globalOutlineRect,
- in CGrafPtr drawPort);
-
- /*
- If the window's resize box(es) are in the window's content region, they should be drawn
- by this method, in the local coordinate system of the window. If they are in the window's
- structure, they should be drawn by DrawFrame.
- */
- void DrawSizeBox(in CGrafPtr drawPort);
-
-
- /*
- The Window Manager will repeatedly call virtual HitTest and HilitePart to determine
- where in the window the cursor is and to give visual feedback.
- */
-
- void HilitePart(in HIWindowPartCode whichPart,
- in boolean hiliteFlag,
- in CGrafPtr drawPort);
- HIWindowPartCode HitTest(in Point globalHitPt);
-
- OSStatus GetPartRgn(in HIWindowRgnCode windowRgn,
- in RgnHandle theRgn);
-
- /*
- Override GetUnusedGadgetRects() so that during drawing you remove any gadget rect space
- occupied by a custom gadget in the title bar that you might draw. This prevents multiple
- clients from drawing custom gadgets on top of eachother.
- */
-
- OSStatus GetUnusedGadgetRects( out Rect leftRect,
- out Rect rightRect);
-
- /*
- The Window Manager will call GetGrowDirection to determine the direction(s) in which the
- window is being resized. It will then call DrawOutline in XOR mode to repeatedly draw and
- erase the window outline as it is resized.
- */
-
- HIWindowGrowDirection GetGrowDirection(in Point globalHitPt);
-
-
- // ===========================================================
- // Procedural Calls
- // These are not object methods, but rather static functions
- // ===========================================================
-
- HILayerRef GetPrimaryLayer();
-
- // • Window groups •
-
- OSStatus NewWindowGroup(out HIWindowGroupRef newGroup);
- OSStatus DisposeWindowGroup(in HIWindowGroupRef groupToDispose);
- OSStatus AddWindowGroupToWindowGroup( in HIWindowGroupRef baseGroup,
- in HIWindowGroupRef groupToAdd);
- OSStatus RemoveWindowGroupFromWindowGroup( in HIWindowGroupRef baseGroup,
- in HIWindowGroupRef groupToRemove);
-
- HIWindowGroupRef GetApplicationWindowGroup();
- HIWindowGroupRef GetWindowClassWindowGroup(in HIWindowClass windowClass);
-
- OSStatus GetWindowsInWindowGroup( in HIWindowGroupRef group,
- in ItemCount requestedWindows,
- out ItemCount totalWindows,
- inout HIWindow windows);
-
- OSStatus GetWindowsInWindowGroupAndLayer( in HIWindowGroupRef group,
- in HILayerRef layer,
- in ItemCount requestedWindows,
- out ItemCount totalWindows,
- inout HIWindow windows);
-
- OSStatus GetWindowGroupsInWindowGroup( in HIWindowGroupRef group,
- in ItemCount requestedGroups,
- out ItemCount totalGroups,
- inout HIWindowGroupRef groups);
-
- // • Front window information •
-
- HIWindow FrontWindowOfWindowGroup(in HIWindowGroupRef group);
- HIWindow FrontNonFloatingWindow();
-
- // • Floating windows •
-
- void ShowFloatingWindows();
- void HideFloatingWindows();
- boolean AreFloatersVisible();
-
- void ActivateFloatingWindows();
- void DeactivateFloatingWindows();
-
- // • Automatic palette activation •
-
- void EnableAutomaticPaletteActivation();
- void DisableAutomaticPaletteActivation();
- boolean IsAutomaticPaletteActivationEnabled();
-
- // • WindowPtr -> HIWindow conversion •
-
- // NOTE: THIS IS A DEPRECATED API THAT IS NOT CONSIDERED SYSTEM 8 SAVVY. IT IS PROVIDED SO SYSTEM 7
- // CLIENTS CAN ADD SOME SYSTEM 8 WINDOW MANAGER FEATURES TO THEIR APPLICATIONS BY CALLING
- // HIWINDOW METHODS. ••• CLIENTS CALLING THIS API WILL NOT WORK ON GERSHWIN •••
-
- HIWindow GetHIWindow(in WindowPtr targetWindow);
-
-
-
- // ======================================================
- // Implementation
- // ======================================================
-
- implementation
- {
-
- passthru C_h = "#include <Types.h>"
- "#include <Windows.h>"
- "#include <HIWindowTypes.h>"
- "#include <HIEmbeddingPanels.h>";
-
- passthru C_xh = "#include <Types.h>"
- "#include <Windows.h>"
- "#include <HIWindowTypes.h>"
- "#include <HIEmbeddingPanels.xh>";
-
-
- GetPrimaryLayer: procedure, noself;
- NewWindowGroup: procedure, noself;
- DisposeWindowGroup: procedure, noself;
- AddWindowGroupToWindowGroup: procedure, noself;
- RemoveWindowGroupFromWindowGroup: procedure, noself;
- GetApplicationWindowGroup: procedure, noself;
- GetWindowClassWindowGroup: procedure, noself;
- GetWindowsInWindowGroup: procedure, noself;
- GetWindowsInWindowGroupAndLayer: procedure, noself;
- GetWindowGroupsInWindowGroup: procedure, noself;
- FrontWindowOfWindowGroup: procedure, noself;
- FrontNonFloatingWindow: procedure, noself;
- ShowFloatingWindows: procedure, noself;
- HideFloatingWindows: procedure, noself;
- AreFloatersVisible: procedure, noself;
- ActivateFloatingWindows: procedure, noself;
- DeactivateFloatingWindows: procedure, noself;
- EnableAutomaticPaletteActivation: procedure, noself;
- DisableAutomaticPaletteActivation: procedure, noself;
- IsAutomaticPaletteActivationEnabled: procedure, noself;
- GetHIWindow: procedure, noself;
-
-
- releaseorder: InitWindow,
- InitWindowInLayer,
- Select,
- SelectWithGroup,
- Hilite,
- Unhilite,
- BringToFront,
- SendBehind,
- ShowWithoutActivate,
- HideWithoutActivate,
- Zoom,
- ZoomOut,
- Collapse,
- Expand,
- SetAttachedWindowGroup,
- GetAttachedWindowGroup,
- AddToGroup,
- RemoveFromGroup,
- InvalidateRect,
- InvalidateRgn,
- ValidateRect,
- ValidateRgn,
- SetPort,
- BeginUpdate,
- EndUpdate,
- DrawGrowIcon,
- PositionOnScreen,
- AutoPosition,
- IsPositionedOnScreen,
- SetAttributes,
- GetAttributes,
- SetClass,
- GetClass,
- SetVariant,
- GetVariant,
- GetStructureRgn,
- GetContentRgn,
- GetUpdateRgn,
- SetStandardState,
- GetStandardState,
- SetUserState,
- GetUserState,
- GetRootPanel,
- SetRootPanel,
- GetEventDispatcher,
- IsHilited,
- IsActive,
- IsCollapsed,
- HandleMouseDown,
- HandleMouseMoved,
- HandleMouseStoppedMoving,
- HandleMouseUp,
- HandleMouseDownInBack,
- HandleResize,
- HandleClose,
- TrackPart,
- DrawFrame,
- DrawOutline,
- DrawSizeBox,
- HilitePart,
- HitTest,
- GetPartRgn,
- GetUnusedGadgetRects,
- GetGrowDirection,
- GetPrimaryLayer,
- NewWindowGroup,
- DisposeWindowGroup,
- AddWindowGroupToWindowGroup,
- RemoveWindowGroupFromWindowGroup,
- GetApplicationWindowGroup,
- GetWindowClassWindowGroup,
- GetWindowsInWindowGroup,
- GetWindowsInWindowGroupAndLayer,
- GetWindowGroupsInWindowGroup,
- FrontWindowOfWindowGroup,
- FrontNonFloatingWindow,
- ShowFloatingWindows,
- HideFloatingWindows,
- AreFloatersVisible,
- ActivateFloatingWindows,
- DeactivateFloatingWindows,
- EnableAutomaticPaletteActivation,
- DisableAutomaticPaletteActivation,
- IsAutomaticPaletteActivationEnabled,
- GetHIWindow,
-
- reserved0,
- reserved1,
- reserved2,
- reserved3,
- reserved4,
- reserved5,
- reserved6,
- reserved7,
- reserved8,
- reserved9,
- reserved10,
- reserved11,
- reserved12,
- reserved13,
- reserved14,
- reserved15,
- reserved16,
- reserved17,
- reserved18,
- reserved19,
- reserved20,
- reserved21,
- reserved22,
-
- HandleUpdate,
- SetDefaultGrowLimits,
- GetDefaultGrowLimits,
- SetDefaultOptimalSize,
- GetDefaultOptimalSize,
- AdjustDragLimits,
- AdjustGrowLimits;
- };
- };
-
- #endif
-